/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { BaseResponse_CompetitionVO_ } from '../models/BaseResponse_CompetitionVO_';
import type { BaseResponse_int_ } from '../models/BaseResponse_int_';
import type { BaseResponse_List_QuestionVO_ } from '../models/BaseResponse_List_QuestionVO_';
import type { BaseResponse_long_ } from '../models/BaseResponse_long_';
import type { BaseResponse_Page_CompetitionVO_ } from '../models/BaseResponse_Page_CompetitionVO_';
import type { CompetitionQueryRequest } from '../models/CompetitionQueryRequest';
import type { CompetitionSaveRequest } from '../models/CompetitionSaveRequest';
import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';
export class CompetitionControllerService {
    /**
     * deleteCompetition
     * @param id id
     * @returns BaseResponse_int_ OK
     * @returns any Created
     * @throws ApiError
     */
    public static deleteCompetitionUsingPost(
        id?: number,
    ): CancelablePromise<BaseResponse_int_ | any> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/competition/delete/competition',
            query: {
                'id': id,
            },
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }
    /**
     * getIsRegistry
     * @param competitionId competitionId
     * @param userId userId
     * @returns BaseResponse_long_ OK
     * @throws ApiError
     */
    public static getIsRegistryUsingGet(
        competitionId?: number,
        userId?: number,
    ): CancelablePromise<BaseResponse_long_> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/api/competition/get/isRegistry',
            query: {
                'competitionId': competitionId,
                'userId': userId,
            },
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }
    /**
     * getQuestionList
     * @param id id
     * @returns BaseResponse_List_QuestionVO_ OK
     * @throws ApiError
     */
    public static getQuestionListUsingGet(
        id?: number,
    ): CancelablePromise<BaseResponse_List_QuestionVO_> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/api/competition/get/question',
            query: {
                'id': id,
            },
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }
    /**
     * getCompetitionById
     * @param id id
     * @returns BaseResponse_CompetitionVO_ OK
     * @throws ApiError
     */
    public static getCompetitionByIdUsingGet(
        id?: number,
    ): CancelablePromise<BaseResponse_CompetitionVO_> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/api/competition/getById',
            query: {
                'id': id,
            },
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }
    /**
     * listPageCompetitionVO
     * @param queryRequest queryRequest
     * @returns BaseResponse_Page_CompetitionVO_ OK
     * @returns any Created
     * @throws ApiError
     */
    public static listPageCompetitionVoUsingPost(
        queryRequest: CompetitionQueryRequest,
    ): CancelablePromise<BaseResponse_Page_CompetitionVO_ | any> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/competition/list/page',
            body: queryRequest,
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }
    /**
     * saveCompetition
     * @param data data
     * @returns BaseResponse_int_ OK
     * @returns any Created
     * @throws ApiError
     */
    public static saveCompetitionUsingPost(
        data: CompetitionSaveRequest,
    ): CancelablePromise<BaseResponse_int_ | any> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/competition/save/competition',
            body: data,
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }
    /**
     * updateCompetitionState
     * @param id id
     * @param state state
     * @returns BaseResponse_int_ OK
     * @returns any Created
     * @throws ApiError
     */
    public static updateCompetitionStateUsingPost(
        id?: number,
        state?: number,
    ): CancelablePromise<BaseResponse_int_ | any> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/competition/update/competitionState',
            query: {
                'id': id,
                'state': state,
            },
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }
    /**
     * updateUserRegistry
     * @param competitionId competitionId
     * @param isAdd isAdd
     * @param userId userId
     * @returns BaseResponse_int_ OK
     * @throws ApiError
     */
    public static updateUserRegistryUsingGet(
        competitionId?: number,
        isAdd?: number,
        userId?: number,
    ): CancelablePromise<BaseResponse_int_> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/api/competition/update/userRegistry',
            query: {
                'competitionId': competitionId,
                'isAdd': isAdd,
                'userId': userId,
            },
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }
}
